using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.System;

/// <summary>
/// 系统通知分类实体类
/// 用于管理通知消息的分类和发送配置
/// </summary>
/// <remarks>
/// 该类继承自TreePoco，支持树形结构的分类管理，
/// 可以配置不同分类的发送方式（站内信、短信、邮箱、APP推送等）
/// </remarks>
public class SysNotificationCategory : TreePoco<SysNotificationCategory>
{
    /// <summary>
    /// 获取或设置分类名称
    /// </summary>
    /// <value>通知分类的名称，不能为空，最大长度128字符</value>
    [Display(Name = "分类名称", Description = "通知分类的名称", GroupName = "基本信息")]
    [Required(ErrorMessage = "分类名称不能为空")]
    [MaxLength(128)]
    public string Name { get; set; }

    /// <summary>
    /// 获取或设置分类编码
    /// </summary>
    /// <value>通知分类的唯一编码，最大长度64字符</value>
    [Display(Name = "分类编码", Description = "通知分类的唯一编码", GroupName = "基本信息")]
    [MaxLength(64)]
    public string Code { get; set; }

    /// <summary>
    /// 获取或设置分类描述
    /// </summary>
    /// <value>通知分类的详细描述，最大长度512字符</value>
    [Display(Name = "分类描述", Description = "通知分类的详细描述", GroupName = "基本信息")]
    [MaxLength(512)]
    public string Description { get; set; }

    /// <summary>
    /// 获取或设置分类图标
    /// </summary>
    /// <value>通知分类的图标样式类名，最大长度64字符</value>
    [Display(Name = "分类图标", Description = "通知分类的图标", GroupName = "基本信息")]
    [MaxLength(64)]
    public string Icon { get; set; }

    /// <summary>
    /// 获取或设置是否启用站内信
    /// </summary>
    /// <value>是否为该分类启用站内信通知</value>
    [Display(Name = "启用站内信", Description = "是否启用站内信通知", GroupName = "发送配置")]
    public bool EnableInternalMessage { get; set; } = true;

    /// <summary>
    /// 获取或设置是否启用短信
    /// </summary>
    /// <value>是否为该分类启用短信通知</value>
    [Display(Name = "启用短信", Description = "是否启用短信通知", GroupName = "发送配置")]
    public bool EnableSms { get; set; } = false;

    /// <summary>
    /// 获取或设置是否启用邮件
    /// </summary>
    /// <value>是否为该分类启用邮件通知</value>
    [Display(Name = "启用邮件", Description = "是否启用邮件通知", GroupName = "发送配置")]
    public bool EnableEmail { get; set; } = false;

    /// <summary>
    /// 获取或设置是否启用APP推送
    /// </summary>
    /// <value>是否为该分类启用APP推送通知</value>
    [Display(Name = "启用APP推送", Description = "是否启用APP推送通知", GroupName = "发送配置")]
    public bool EnableAppPush { get; set; } = false;

    /// <summary>
    /// 获取或设置是否启用微信推送
    /// </summary>
    /// <value>是否为该分类启用微信推送通知</value>
    [Display(Name = "启用微信推送", Description = "是否启用微信推送通知", GroupName = "发送配置")]
    public bool EnableWechatPush { get; set; } = false;

    /// <summary>
    /// 获取或设置是否启用钉钉推送
    /// </summary>
    /// <value>是否为该分类启用钉钉推送通知</value>
    [Display(Name = "启用钉钉推送", Description = "是否启用钉钉推送通知", GroupName = "发送配置")]
    public bool EnableDingTalkPush { get; set; } = false;

    /// <summary>
    /// 获取或设置默认优先级
    /// </summary>
    /// <value>该分类下通知消息的默认优先级</value>
    [Display(Name = "默认优先级", Description = "该分类通知的默认优先级", GroupName = "发送配置")]
    public PriorityEnum DefaultPriority { get; set; } = PriorityEnum.普通;

    /// <summary>
    /// 获取或设置是否启用
    /// </summary>
    /// <value>是否启用该通知分类</value>
    [Display(Name = "是否启用", Description = "是否启用该通知分类", GroupName = "状态信息")]
    public bool IsEnabled { get; set; } = true;

    /// <summary>
    /// 获取或设置排序号
    /// </summary>
    /// <value>分类的显示排序号</value>
    [Display(Name = "排序号", Description = "分类的显示排序", GroupName = "状态信息")]
    public int SortOrder { get; set; } = 0;
}